﻿#ifndef TOOLBARZOOM_H
#define TOOLBARZOOM_H

#include "MeasureView_global.h"
#include <QSettings>
#include <QToolBar>
class QSpinBox;
class QDoubleSpinBox;
class QCheckBox;

namespace Qly {

class MeasureView;
class MEASUREVIEW_EXPORT ToolBarZoom : public QToolBar
{
    Q_OBJECT
public:
    ToolBarZoom(const QString &title, QWidget *parent = Q_NULLPTR);
    ToolBarZoom(QWidget *parent = Q_NULLPTR);
    void attach(MeasureView *widget);
    void loadSettings(QSettings &settings);
    void writeSettings(QSettings &settings);
public slots:
    void setZoomFactor(double f);
private:
    void on_spinBoxZoomValueChanged(int n);
    void on_checkBoxToggled(bool on);
    void on_doubleSpinBoxRotateValueChanged(double v);
    void on_spinBoxCrossLineLength(int n);
private:
    void initContent();
private:
    QSpinBox *spinBoxZoom;
    QCheckBox * checkBox;
    QDoubleSpinBox *spinBoxRotate;
    QSpinBox *spinBoxCrossLineLength;

    MeasureView *pMeasureView;
};

} //namespace Qly
#endif // TOOLBARZOOM_H
